import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class BServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 从request范围中取出数据AServlet存入的数据
        Object obj = request.getAttribute("userObj");
        response.getWriter().print(obj);  //浏览器打印为null
    }
}
